#include<fstream>
#include<string>
#include<vector>
#include<iostream>
#include "cutword.h"
using std::ifstream;
using std::string;
using std::vector;
string readString(const string &path){
    ifstream ifs(path);
    if(ifs.fail()){
        std::cout<<"文件不存在,请检查"<<std::endl;
    }else{
        string str;
        string res;
        while(getline(ifs,str)){
            res +=str;
        }
        return res;
    }
    return "";

}

vector<string> readfile(const string& path){
    ifstream ifs(path);
    if(ifs.fail()){
        std::cout<<"文件不存在,请检查"<<std::endl;
    }else{
        string str;
        vector<string> res;
        while(getline(ifs,str)){
            res.emplace_back(str);
        }
        return res;
    }
    return vector<string>();
}